import request from '@/utils/request'

// 查询套餐审核列表
export function listCarPackage(query) {
  return request({
    url: '/audit/carPackage/list',
    method: 'get',
    // 地址栏问号后面带的参数
    params: query
  })
}

// 查询待办套餐审核列表
export function listToDoCarPackage(query) {
  return request({
    url: '/audit/carPackage/listToDoCarPackage',
    method: 'get',
    // 地址栏问号后面带的参数
    params: query
  })
}


// 查询已办套餐审核列表
export function listDoneCarPackage(query) {
  return request({
    url: '/audit/carPackage/listDoneCarPackage',
    method: 'get',
    // 地址栏问号后面带的参数
    params: query
  })
}

// 查询审核历史
export function queryAuditHistories(instanceId) {
  return request({
    url: '/audit/carPackage/queryAuditHistories/' + instanceId,
    method: 'get'
  })
}

// 查询套餐审核详细
export function getCarPackage(id) {
  return request({
    // 路径参数
    url: '/audit/carPackage/' + id,
    method: 'get'
  })
}

// 新增套餐审核
export function addCarPackage(data) {
  return request({
    // 用json格式来接收请求参数
    url: '/audit/carPackage',
    method: 'post',
    data: data
  })
}

export function startAuditServiceItem(data) {
  return request({
    // 用json格式来接收请求参数
    url: '/audit/carPackage/startAuditServiceItem',
    method: 'post',
    data: data
  })
}

// 修改套餐审核
export function updateCarPackage(data) {
  // 用json格式来接收请求参数
  return request({
    url: '/audit/carPackage',
    method: 'put',
    data: data
  })
}

export function cancelCarPackage(instanceId) {
  // 路径参数
  return request({
    url: '/audit/carPackage/cancelCarPackage/' + instanceId,
    method: 'delete'
  })
}

// 审核套餐信息
export function auditServiceItem(data) {
  // 用json格式来接收请求参数
  return request({
    url: '/audit/carPackage/auditServiceItem',
    method: 'put',
    data: data
  })
}

// 查看流程图
export function queryProcess(instanceId){
  return request({
    
    url: `/audit/carPackage/queryProcess/${instanceId}`,
    method: 'get'
  })
}
